package com.leetcode.algorithm.y22.m08.w3;

/**
 * 1450. 在既定时间做作业的学生人数
 * 
 * https://leetcode.cn/problems/number-of-students-doing-homework-at-a-given-time/
 * 
 * @author jie.deng
 *
 */
class Question1450Solution01 {

	public int busyStudent(int[] startTime, int[] endTime, int queryTime) {
		int len = startTime.length;
		int cnt = 0;
		for (int i = 0; i < len; i++) {
			if (queryTime >= startTime[i] && queryTime <= endTime[i]) {
				cnt++;
			}
		}
		return cnt;
	}

}